/**
 * 
 */
package org.cuatrovientos.password;

import java.util.Random;

/**
 * @author david_berrade
 *
 */
public class Password {
	
	/**
	 * gives you a password
	 * @param lenght
	 * @return
	 */
	public static String generatePassword (int lenght){
	
		String result="";
		Random random =new Random();
		
		String value="abcdefghijklmnopqrstvwyz0123456789";
		
		int randomPosition=0;
		for(int i=0; i<lenght; i++){
			randomPosition= random.nextInt(value.length());
			
			result+=value.charAt(randomPosition);
		}
			return result;
			
			
		
		
		
		
	}
	
	
	
	
	

	/**
	 * A program that gives you a random pass
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		for (int i=0;i<50;i++){
			System.out.println(Password.generatePassword(10));
		}

	}

}
